package com.sirun.ble.bean;

import com.sirun.ble.enums.VehicleStatusEnum;
import com.sirun.ble.utils.AwDataUtil;

import java.io.Serializable;

/**
 * @author : hzw
 */
public class CarStatusBean implements Serializable {

    /**
     * 门锁状态  0:开  1:关
     */
    private  int doorStatus;

    private String miles;
    private String soc;

    /******************************************* START ******************************************************/

    public String getDoorStatusStr() {
        if(doorStatus == -1 || doorStatus == VehicleStatusEnum.COMMON_ERROR.code) {
            return VehicleStatusEnum.COMMON_ERROR.desc;
        }
        if(doorStatus == VehicleStatusEnum.DOOR_STATUS_OPEN.code) {
            return VehicleStatusEnum.DOOR_STATUS_OPEN.desc;
        } else {
            return VehicleStatusEnum.DOOR_STATUS_CLOSE.desc;
        }
    }


    /******************************************* END ******************************************************/

    public int getDoorStatus() {
        if(AwDataUtil.isEmpty(doorStatus)) {
            return VehicleStatusEnum.COMMON_ERROR.code;
        }
        return doorStatus;
    }

    public void setDoorStatus(int doorStatus) {
        this.doorStatus = doorStatus;
    }

    public String getMiles() {
        return miles;
    }

    public void setMiles(String miles) {
        this.miles = miles;
    }

    public String getSoc() {
        return soc;
    }

    public void setSoc(String soc) {
        this.soc = soc;
    }

    @Override
    public String toString() {
        return "CarStatusBean{" +
                "doorStatus=" + doorStatus +
                ", miles='" + miles + '\'' +
                ", soc='" + soc + '\'' +
                '}';
    }
}
